package com.zhengke.service.cwhs;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhengke.common.object.Result;
import com.zhengke.dao.CashStatisticsDao;
import com.zhengke.pojo.CashStatistics;
/**
 * *******************************
 * 	项目名称：tvmall-parent
 * 	文件名称：CashStatisticsServiceImpl.java
 * 	类说明：
 *
 * @author 王鑫
 * @version 1.0
 * *******************************
 */
@Service
public class CashStatisticsServiceImpl implements CashStatisticsService {

	@Autowired
	CashStatisticsDao dao;
	
	@Override
	public Result queryList(CashStatistics cs, int page,int limit) {
		/**
		 * 开启分页
		 */
		PageHelper.startPage(page, limit, true);
		Result rs = new Result();
		List<CashStatistics> list = dao.queryList(cs);
		PageInfo<CashStatistics> pageInfo = new PageInfo<CashStatistics>(list);
		rs.setCode("0");
		rs.setCount(pageInfo.getTotal());
		rs.setData(list);
		return rs;
	}

}
